package com.zlp.controller;

import java.util.*;

public class TestCon {

    public static void main(String[] args) {

        List<Map<String,Object>> lista = new ArrayList<>();
        Date currentDate = new Date();
        long time = currentDate.getTime();

        Map<String,Object> ob = new HashMap<>();
        ob.put("time",time);
        Date currentDate1 = new Date();
        Map<String,Object> ob2 = new HashMap<>();
        long time1 = currentDate.getTime();
        ob.put("time",time1);
        for (int i = 0; i < lista.size()-1; i++) {
            for (int j = i + 1; j < lista.size(); j++) {
                Map mpa1 = lista.get(i);
                long time2 = (long) mpa1.get("time");
                Map mpa2 = lista.get(j);
                long time3 = (long) mpa2.get("time");

                if (time2 < time3) {
                    // 进行交换
                    long temp = time2;
                    time2 = time3;
                    time3 = temp;

                }
            }
            
        }

        lista.forEach(item ->{
            System.out.println("fdsf");
            System.out.println(item.get("time"));
        });

    }
}
